Not all sunscreens are made equal. In fact, there are two main categories of sunscreens: chemical sunscreens and physical sunscreens. Many sunscreens are a combination of both. Which is better depends on your own preference.
Chemical sunscreens often contain ingredients such as avobenzone or oxybenzone. These are chemicals that absorb the UV energy to reduce its impact on the skin. Physical sunscreens often contain ingredients such as titanium dioxide or zinc oxide. These sunscreens use minerals to physically block the oncoming UV rays. Hence, these types of sunscreens are often thicker and more opaque in consistency compared to chemical sunscreens. In recent years, physical sunscreens have become more aesthetically sophisticated, and many companies manufacture physical sunscreens with micronized zinc and titanium particles, which reduces the opacity of the product.
In a small subset of people with more sensitive skin, chemical sunscreens may have a higher chance of causing allergic reactions. The common culprits are ingredients such as oxybenzone and padimate O, and avobenzone. If you are one of these people, switch over to a 100% physical sunscreen. There are many companies that make purely physical sunscreen products.