If you’re using Hibernate for several years, you might remember the time when you had to define all your mappings in the orm.xml file. You had a bunch of Java classes which represented your domain model and a long XML file with the mapping and query information. One of the main challenges with that approach was that you had the code and the mapping information in two different files which you had to keep in sync.
All that started to change with the introduction of annotations in Java 5. JPA and Hibernate offered annotations to define the entity mappings and queries. The mapping definitions and queries became part of the entities. That puts all information into one place and makes it easier to understand. You also don’t have to keep multiple files in sync (which I think is an incredible benefit…).