When I change alitutdes mainly. I live in the coastal mountains of BC, Canada and my town is pretty high up. Compared to the rest but there is another city within a city that is plop right smack in the middle of the mountains.
But usually I get it when I change altitudes but I have heard some people’s ear pop after swimming or during swimming.