As an example, in the UK the parliament gathers to debate legislation even if the ruling party has 50%+1 votes, which is sufficient to pass any legislation they please. In this scenario, what makes them even bother dealing with the opposition rather than silently passing any laws they want?
Without contradicting the already existing answers(specially about making each party position and reasons known to the public), I would point that:
Not all parliaments are bipartisan. Different parties can align differently for different laws. Even parties within a coalition government can vote separately on some issues1.
As dsollen comments, in some political systems2 some laws (for example, to change a Constitution) require more votes than a simply majority; the majority party may have enough votes to support the government but not enough to change some of the laws.
MPs have individual votes. Generally, there is no law forcing them to vote along party lines (if it were they could just be replaced by giving the party leaders the right to cast the votes). Due to different reasons (conscience3/representing a district overwhelmingly against the law/others) some MPs may chose to abstain or even to vote against party lines. Of course, if done in critical laws or too often that can lead to that MP being given less support for reelection or even to expulsion.
Law proposals are not "all-or-nothing", and they can be amended, and sometimes opposition initiatives are taken into account. While it would be very unusual for the government to do a U-turn and retire a proposal, it can accept small changes proposed by other parties - either because they are found to be good ideas, or because by doing so they expect some political advantages, for example:
Opposition to the approved law is weaker
Minor opposition means that the losing side has less means to continue opposing the law through other means (popular protests, boycotts, disobedience campaigns, etc.)
It is reasonable to expect that, if the ruling party loses control of the government to a party that voted for the (amended) law, that party will refrain from making major changes to the law.
It may ease negotiations for passing other laws.
1 Although I would expect that a government would take into account the opinion of their supporting parties, that is not always the case. A government could try to pass a law opposed by a supporting party if it is believed that it will not alienate that party enough to let the government fall.
2 I think that is not the case of the UK, though.
3 The example that is more typical (AFAIK) could be abortion or euthanasia laws, which are issues with a strong personal component that often cross socioeconomic affinities that define membership to parties.
Because the rules of parliamentary procedure often guarantee that all factions in the parliament must have the opportunity to comment on a law before it is being voted on. For the UK House of Commons in particular, the rules for debates are codified in the Standing Orders of the House of Commons order 26 - 37.
The opposition will usually use that opportunity to criticize the proposed law. The government will use it to refute and downplay their criticism.
These debates have practically no influence on the actual vote. Usually all the factions will have had an internal meeting before the session where they decided how to vote on the matter. So every member of the parliament will already have decided how to vote before even entering the parliament.
You might wonder what's the point of having these debates in the first place if they don't contribute to the political decision making process. It is usually done to make the reasons behind a law transparent to the constituents. The protocols of parliamentary debates are usually public. When it's time for election, the voters can look up what the incumbent representatives said during parliament debates and judge for themselves how much they align with their own opinions.
Legislation is sometimes passed with little or no debate either in an emergency or for uncontroversial technical corrections to the law. There are reasons for the ruling party to want a full debate in parliament:
- Individual members (of all parties) want to have the opportunity to speak in parliament. Making a good performance in parliament can boost their careers. The MPs have a vested interest in keeping parliament relevant.
- Often, some members have particular interest in the bill (e.g if it especially affects their electorate) and they will want to speak about it to either claim credit if it is good or defray responsibility if it is painful.
- The members are not obliged to vote along party lines. The party will have sanctions against them if they cross the floor but it must also provide them with positive incentives. If enough parliamentary party members are dissatisfied with the executive, they can install a new executive.
- The parliamentary debate is a well-reported public forum where the ruling party can sell the virtues of their policy to the electorate and score rhetorical points against the opposition.
- The electorate is generally suspicious of decisions made without public debate. A party that gags debate without good reason will likely be seen as out-of-touch, arrogant or dictatorial.
- Since the ruling party has the numbers, they don't risk loosing the vote.
- It is not really in the interest of any politician to breach conventions by completely excluding the opposition party because they know they may well be in opposition after the next election.
- Statements made during the parliamentary debate can affect how the courts will interpret the new law.
Without debate the public may be susceptible to opposition messaging on the issue. With debate politicians can go on public record with the reasons why they support such legislation, and perhaps innoculate their constituents to such messaging. Even if it is possible to pass laws in secret (or as you say, without debate), it probably isn't a good idea because your political opponents can point to how secretive you are being even if everyone in the electorate would normally agree with the law being passed.
In cases where your opposition doesn't wish to subvert your message, a politician still could actually believe in the legislation they are wishing to adopt and wish to educate the public on its consequences. Having a parliamentary debate is at least an efficient way of doing so.
Plus it sometimes makes for great TV.
In the German parliament, the development has been very obvious, maybe because it is a relatively young democracy, yet old enough to have completed the circle.
Discussions in parliament are now a form of ritual. Everyone already knows what everyone else is going to say, and how everyone else is going to vote in the end, no matter what is being said. Anyway, everyone goes through the motions.
Note that this happened during the last government periods no matter who the ruling party was and no matter how tight or comfortable the majorities were.
The reason is twofold. Firstly, purpose and history. The parliament is intended as a place where through debate majorities are formed. A parliament what would abandon the debate would question its own purpose and existence. Basically, if your job is some useless nonsense that nobody needs, but you have a family to feed, you don't go and point out to your boss just how redundant you are.
Secondly, those speeches are show for the press. Their purpose is to present to the public where the party stands on issues, so that in the next election, maybe just maybe they will remember. It is part of public relations or maintaining your image and profile as a party. Your voters (existing as well as prospective) simply expect you to speak out against certain things, even if you can't swing the vote.
I cannot speak for the UK system, but here in Canada (which should be roughly the same parliamentary system), MP's can vote as they wish on most issues, unless the ruling government is a minority government, in which case any MP voting against the party will likely be expelled. In addition, MP's can elect to abstain from voting, so even if the majority government has 51% of the seats, it does not mean it has 51% of the votes on every bill.
Party is much less important versus the individual MP elected in a parliamentary system. The representative was elected by his constituents, in his region, and his job is to represent them. One may very well vote against party lines on some issues if they feel the party line goes against the interests of his constituents.
Also, all parliament sessions are televised on CPAC here. Not that a lot of people watch it, but still, the issues need to be discussed before a vote.
When the government manages to get support from some opposition parties on a proposed law, the chances are high, that after a change in government that law will not be immediately revoked and overturned.
In a highly bi-partisan parliament, after a change of government, many of the former-government-only law might quickly be replaced by the new government.
This might even be more so, e.g. in the US, when laws were passed entirely without parliamentry support, i.e. the executive orders of the US president.