Priority is a right given and recognized by the great majority of countries around the world to the applicant of a trademark that has been filed for the very first time. When filing a specific trademark for the first time, that is, not having applied for the same trademark in any other country or territory before, the owner is granted a 6-month period from the date of first filing in order to be able to file in any other country as if the trademark would have been filed on the date of the first application (if priority is claimed).
If you were to file a trademark for the first time in the United Kingdom on the 1st of January of X year, and then applied for a trademark 4 ½ months later in Germany you would have two options:
Option 1 - NOT claiming priority: The application for the German trademark would then be considered as having been done on the actual date of filing (15th of May of X year).
Option 2 - (YES) Claiming Priority: The application of the German trademark would be considered as having been done on the same date as that of the trademark filed in the United Kingdom. Therefore, although the trademark was actually filed on the 15th of May of X year, it would actually be considered as if it would have been filed 4 ½ months before on the same date as the trademark in the United Kingdom, that is, the 1st of January of X year.