After you file your trademark application and it gets approved after it passes the initial review by the Trademarks Office, it will be published for opposition. This means it's advertised publicly for a set period, which varies by country (one month in the US, two months in Canada, three months in the EU). During this time, anyone can oppose your trademark, asking the Trademarks Office not to register it.
While rare, oppositions can be very stressful and expensive, often costing $30,000 to $40,000. Some trademark owners file oppositions hoping you won't respond, effectively bullying you out of your trademark. Others are legitimate and unavoidable.