Why Did Birds Develop Beaks?

Why do birds have beaks?

.

Why do birds have beaks instead of teeth?

Why did dinosaurs have beaks?

Why did beaks evolve?