why did maria theresa and frederick the great fight two wars against each other