The EU trademark system is dual, which means that you can register a trademark on the EU level or in one or more of the EU member states.
If you choose to register an EU trademark with the EUIPO, your brand will have protection in every EU member state, which currently is 27 countries. If someone copies you, for example, in Spain, you will have legal grounds to stop the infringement. If you don't need EU protection and, let's say, have most of your customers in France, you can register your trademark solely in France.
This way, you will be granted protection against anyone who uses an identical/confusingly similar brand in France. Similarly, you can stop someone from obtaining a trademark with the EUIPO (the EU level) by having a trademark in one of the member countries.