This an extremely complex question because the monarchies all lost power at different times for different reasons. Almost no one will be able to give you an in-depth answer for each one because to do so would require someone to study dozens of nations' unique histories, covering centuries of complex social and political change.
Instead of that, I'm going to give you very shallow answer covering general trends from the late 1700s to early 1900s. I'll tie that back to the general reasons a European monarch might've lost power, but please keep in mind I'm only covering the very basics. If you want to learn more, I encourage you to look into any specific nation I mention that sounds interesting and study the end of their monarchy specifically.
To start, I want to bring your attention to two examples that actually pre-date my above timeframe by a wide margin: England's Magna Carta in 1215 and Hungary's Golden Bull in 1222. These are pretty similar on a basic level. The nobles in both countries banded together, and they extracted an official statement from their kings agreeing to certain limits on their powers. If your really wanted to find the beginning of the end European monarchy, it starts right here; with nobles using their collective power to limit their ruler's absolute power to an agreed upon (or "constitutional") power.
The two terms I just danced around are very important to understanding what happened from the late 1700s to the early 1900s. Those terms are "absolute monarchy" and "constitutional monarchy". An absolute monarch is one with no written limit to their power, an constitutional monarchy is one with a written agreement to limit and share their powers. The two examples above were agreements between nobles and kings, but some would argue the very important distinction that a "constitution" is an agreement between a ruler and the people of their nation.
Now here's where I'm really going to hit fast forward and glaze over centuries of complex political and social change. The Enlightenment brought people an idea that's actually pretty similar to what the nobles of England and Hungary realized. Basically, "You can't do this without us." The nobles realized they were so powerful united, that their kings needed them to agree to be ruled. The people realized rulers only have their powers because people follow them. Thus, people started to really think, "Well what if we all agreed on a better way to run things."
This trend started with Constitutional Monarchy (limit the king's power and share it with the people) and Republicanism (ditch the king entirely and we'll rule ourselves). This is where we get our first examples of what you're really asking about: the short-lived rule of Oliver Cromwell in England, the Dutch and American Republics, and the many French Revolutions switching between all three modes of government listed so far.
But, out of all that, people started asking an even bigger question: "If the government only exists because we agree to it, is it the government's job to serve us or is it our job to serve it?" The answers were Socialism, Fascism, Anarchism, and a whole new wave of revolutions.
TLDR: All of this is to say, the "trend" I mentioned from the late 1700s to the early 1900s was two separate waves of political thought and revolution. "What's our relationship with our king" and "what's our relationship with our government?" How different European monarchs answered those questions is what caused their answers to your question. The English monarchy adapted with the times, giving away more and more of their power until they became ceremonial. The Russian monarchy tried to stay "absolute" until it was destroyed by its people in 1918. The Spanish and French were divided and went through multiple periods of Monarchy, Republicanism, and Dictatorship. And, of course, some monarchies were destroyed from outside when they lost the two big duels of all the ideologies listed: the world wars. The German and Austro-Hungarian monarchies were signed away for losing WWI, the Italian monarchy lost a vote to exist after WWII.