When you apply for a trademark, your application will get evaluated by the intellectual property office of the country where you are seeking protection. The assessment takes between 4-18 months on average, depending on the country, and comprises multiple stages.
The examiner will first look at whether your mark meets the distinctiveness criterion, i.e. whether it is unique enough to be distinguishable as the source of goods/services you offer. Generic or descriptive marks are generally not accepted.
The examiner will also check whether your mark is not in similarity conflict with other already registered trademarks since that would constitute an infringement on those existing trademarks. The next steps then depend on the jurisdiction. Some IP offices stop the application if they discover a conflict, while others merely notify the owners and give them a chance to come forward and oppose the application.
If the examiner doesn't raise any issues or the application manages to address all of them, the application moves to the next stage, called the opposition window. Here, owners of already registered trademarks (including, but not limited to, the ones who may have been notified by the examiner in the previous stage) can come forward and raise an opposition. If that happens, the applicant is notified. The next steps again depend on the country, but in general, both sides can either resolve an issue amicably or the opposition proceedings start.
If no oppositions are raised or if they are resolved, the trademark gets accepted, and the applicant receives a trademark certificate.