"The military wanted a new breed of bomber that would be able to travel beyond enemy lines at great distances and drop bombs with precision. It needed to be able to reach altitudes high enough to fly outside of the range of enemy antiaircraft artillery."

The precision was never what it might have been, and there were substantial losses to flak. But it was an impressive machine for its day.

Red Wrench films did a comparison of the B-17 and B-24 bomber's results based on flight characteristics, bombing accuracy, loss rates and more. Even though more B-24s were produced than B-17s the latter had much better results.

https://www.youtube.com/watch?v=hM8eKEqiO2Y