Brought down by a combination of constitutional convention and practical politics.
The fundamental requirement of a government is to command a majority of the Commons (or whatever the lower house is called; in Canada and the UK it’s the Commons, in Australia it’s the House of Representatives). That’s called the “confidence of the House.”
If the government cannot command a majority in the Commons, then as both a constitutional matter, and as a matter of hard-knuckle politics, that government is on the way out. If the loss of confidence occurs shortly after an election, by custom the Crown will call on one of the other parties to try to form a government. If the loss of confidence occurs after the government has been in power for some time, it is more likely that the PM will request a dissolution of the House and a general election.
But you won’t find that concept of confidence written in our Constitutions - it’s the way the parliamentary system has evolved over the past two centuries. It’s how the system works - no need to write it down anywhere. We get it.
There are a variety of different ways that there can be a vote of non-confidence.
The most formal one is an actual motion of non-confidence: The Opposition tables a motion “Whereas [long laundry list of things that the Opposition doesn’t like about the Government], therefore this House does not have confidence in the Government.” It’s like any other motion, gets debated and voted on. Exactly how often the Opposition can move non-confidence depends on the rules of the House; in Canada, I think at the federal level each Opposition party can only bring one formal motion of non-confidence per session of the Commons.
Then, there are two matters which are always confidence matters: the vote on the Speech from the Throne (as it’s called in Canada), and the budget. The reason these are confidence matters are that the Speech sets out the government’s entire policy platform for the upcoming session, while the budget is the implementation of the government’s policy in fiscal terms. If the government can’t get a majority on either of those items, then it really is in no position to govern.
The third type of confidence matters are those that the government itself says are confidence matters: that the proposed Act is so essential to the government’s policies that if it loses the vote, it will interpret it as a loss of confidence, triggering an election This is the ultimate weapon that the Prime Minister and Cabinet have to keep their own caucus in line, and also to keep the Opposition from going off half-cocked. Like hanging, knowing that you’re going to face an election suddenly tends to concentrate one’s attention. It’s a game of chicken between the PM and the Leader of the Opposition: “Is this really the hill you want to die on?”
As for the mechanics of it, it’s very simple. If the PM and the government lose a vote on a confidence measure, the usual outcome is that the PM goes to the Queen (or her representative, in one of the Commonwealth realms like Canada), and advises that she exercise her power to dissolve Parliament, triggering a general election. The Queen does have a reserve power to refuse a dissolution, particularly if the confidence issue arose shortly after the last election and there may be a viable government to be formed out of the Opposition parties, but in practice she normally follows that advice and there’s a general election.