First of all the left-right political spectrum originates from the sitting order in the French national assembly after the revolution where the conservative monarchists grouped themselves on the right and the revolutionaries on the left.
And from there they are used to construct spectra based on contrastive pairs loosely based on that. Like conservative-progressive, national-international, elitist-egalitarian, individualism-collectivism, capitalism-socialism and so on as well as a variety of overtone windows for these spectra that relate to a certain location and era.
The most common and most descriptive contrastive pair or scale is that of social equality or social hierarchies. So proponents or advocates of social inequality would be on the right and proponents of social equality would be on the left.
Now with a Eurocentristic perspective the 18th and 19th century featured a lot of change. The old regime was a feudal caste system. With nobility, clergy and peasantry, that was very unequal and supported that inequality based on a religious narrative as well as a claim of "aristocracy" (rule of the best). And which drew it's wealth largely from the exploitation of it's peasantry as well as trade and warfare.
And then it became under attack from all angles. Science, philosophy and inter religious struggles undermined the cultural hegemony of the church and the religious narrative.
Due to various factors some section of the peasant caste got into wealth outside of the feudal aristocratic system and thus was rich but powerless in the lowest class. Which lead to demands and ideas to restructure societies. Equal rights, limitations of aristocratic privilege through constitutions, social contracts, republics, democracies and so on.
And at least some of these movement couldn't be repressed by force anymore, leading to successful revolutions like in the U.S. or in France and the establishment of a republic.
Now based on their rhetoric and contrasted with conservative monarchists, these classical liberals were pretty left wing. As in consequence of their demand there would be a reduction of social hierarchies and social inequality. Like abolition of the feudal caste system, equal political rights, reduction of aristocratic privilege, broadened political participation and if you count their rhetoric "equality, liberty, brotherhood" "All men are created equal..." and whatnot, that gave rise to hopes and dreams of direct self-governance of the people by the people for the people.
In reality however they were still subjects of their time and their route to power was through unregulated economic growth, in opposition to the ruling class of the caste/state, demanding and defending individual rights and considering taxes as largely theft.
So their democracies were often based on taxed income, so while featuring more representation it was still far away from universal suffrage. And that's not including slavery, colonialism, racism, sexism and the like which already put some major asterisks on the liberty and equality claims.
The new representation mostly meant rich people. So in effect the hereditary monarchy with religious legitimization was replaced with a semi-hereditary plutocracy with ownership of the means of production (featuring both the land-based aristocracy and now the factory owners).
So as their system still featured and defended a lot of social inequality leading to them taking up the right wing position in the absence of royalist conservatives or even uneasy alliances between these factions.
Now contrast to the hyperindividual unregulated capitalism which treated each individual as an island and any sort of government as a nuisance that should be reduced to a minimum, there also were factions that took a more wholistic view.
Like yes, you can see "the government" as the tyrannical force making demands and largely sustaining their own existence with that. But as a matter of fact it also fulfills certain roles and the more republican a system gets (the more it becomes a republic where politics is done by the people themselves) the more people have to fulfill these roles themselves or judge for themselves if they are necessary or not. So taxes move from "something that someone else steals from you and that is gone", to the approach of "people pooling some of their money to make an investment that exceeds the ability of any of the individual". So if the public infrastructure costs 1 trillion dollars that's more than almost any individual has in their bank account, but if everyone of the 300 million citizens gives $3330 you've got that covered and that's manageable and the benefits from that are more than worth it.
And the same concept is the source of the capitalists wealth as well, like if snatch a few dollars of every product one of your employees makes, a single person can make a lot of money. And because it takes no effort, but just to already be rich, it increases in effectiveness with property. Meaning at some point there's a direct or indirect redistribution or it approaches a plutocracy.
So there is a lot of power in societies, explicit (like groups, collectives, up to nation states or humanity as a whole) or implicit (like in companies, supply chains, trade networks). The question is: How to organize it. And there the "right wing" ideal is some sort of social hierarchy, monetary, hereditary, religious, sexist, racist, nationalist, militaristic... where one group makes the rules and the rest follows those rules or is penalized. While the "left wing" ideal is that people form a mutual collective of free and equal individuals that work cooperatively and decide for themselves what goals they're working towards in at best a direct discussion.
And the most obvious road block after the political caste system was the fact that those who own the relevant resources decide how they are used, either directly feudalism or indirectly via representative democracies that largely represent rich people and their interests or via extra-governmental concentrations of power.
So ideas of societies where people collectively own and work the means of production and decide things themselves on equal footing were called socialist/communist.
At least that was the ideal. As that was unattainable for several decades due to revolutions (even "liberal" ones) being crushed and sometimes even rolled back, democracies not really featuring broad representation of people and ideas and unregulated capitalism being in overdrive, so there were hundreds if not thousands of people who added their 2 cents on how that could look like, how to get there and whatnot.
From reform, to revolution, from more prioritized on the individual to more proritized on the collective. Like serious there are egoists who advocate for unions of egoists, because there's more to gain from that than selfcentered egoism, arguing it's more selfish to cooperate. The formation of political parties taking part in elections, the formation of unions and general strikes as a political mean, from demonstrations to tyrannicides, from anarchism to statism, from collective ownership, to no ownership, to private ownership with redistribution (thus indirect ownership by the people) and so on.
Like seriously if you're free to envision a utopia there were lots of people who had ideas about that. And no despite having ostensibly the same goal they did not agree on the means and priorities. Like the first international ended with Marx kicking out the anarchists cementing the claim of his group to the definition of "communism". The second apparently ended with WWI when it was split into pro-war-allied-socialist, pro-war-central-powers-socialists and "WTF! Since when are in support of workers shooting each other for imperialist goals"-socialists as well as a split between reformist social democrats and revolutionary socialists. And so on.
It's more like 2 leftists 3 opinions. Which is on the one hand actually good, because dissent and discussion are important but which also means that the most "successful" representative ended up being the Soviet union and the system that they exported to various other countries. Which deviated quite a lot from the ideal... So much so that they realized that themselves and went with a redefinition of "socialism" as a "transitional state" rather than "communism". And still, dictatorship, repression, imperialism, misinformation and general unreliability, state level terror, genocides, totalitarianism. There's a lot to criticize. Like Lenin already lost the initial election of the Soviet Union and as a result murdered a whole bunch of leftists as well.
Also faced with the prospect of successful working class revolutions many western countries often had to reform their system to decrease inequality and the threat of a revolution. And while not going for the socialist goal of collectivizing the means of production social democrats and unions have often decreased the gap between the rich and poor thus making the democracy actually more democratic than they used to be.