I get that three pronged wires have the earthing wire and all but unless we plug it incorrectly or something along those lines, two prongs work just fine right?
No, incorrect. The ground wire is mainly used for safety, to ground a metal case to protect from electrocution should the case become live with mains due to a malfunction in a device, but it is also used for functional purposes such as mains filtering or setting the device potential to have a ground reference.
Two pronged devices need to be different from three pronged devices, so they are not the same, and even if the device has no fault inside it that would be hazardous which would suggest that the third prong is not necessary for safety, it is still used by th circuit for correct function and operation as specified, which is why a three pronged device must never ever for safety and functional reasons be connected to non-earthed socket. (People who do that and say it's fine and nothing bad has ever happened to them don't understand the risk when plugging powered devices into each other or the risk of death if the metal parts become live with mains).
The third prong (ground, earth, PE or whatever it may be called) is not only used for safety such as grounding a metal case. It may serve other functions as well, maybe to aid in mains filtering or providing a common ground potential to equipment so that they do not float in respect to each other.
A device with three-prong inlet means it needs the third prong for proper operation, and on many three-pronged devices it reads that they must not be connected to an ungrounded (two-pronged) socket.
The whole power supply needs to be designed based on if the intention is to connect to a grounded or ungrounded socket.
If the power supply or the appliance has a metal case, such as your average metal cased desktop PC computer, then the grounding or earthing is for safety, and it can also be used for mains filtering in switch mode power supplies or providing common reference to equipment so they do not float and have a lot of voltage between them, such as for sensitive audio and data connections being made safely while the devices are powered.
And if mains ground is used by the mains inlet filter circuit, connecting to ungrounded socket renders the filter useless, and what's even worse, also makes the metal parts of your PC to float capacitively at half the mains AC voltage, which may shock you a bit if you touch the PC metal parts and something that's grounded, and that's a nasty surprise (at least in 230VAC countries). It can also damage something if you connect your PC that might be capacitively charged to 100V while plugging it into another device with 0V potential on it's audio or data port.
If the power supply or the appliance has a plastic case and no user touchable metal parts or no external connections to other devices, such as a fan or power tool battery charger, you don't need grounding or earthing for safety, but some power supplies have a common mode suppression filter cap between mains input and DC output so things like laptop or mobile phone chargers may still cause small shocks or at least you can feel annoying vibration at mains frequency when e.g. using your laptop. Which is why laptop chargers tend to have a ground prong.
A device like a hair dryer has no metal case, no user touchable metal parts, and no external connections, and does not need the electronics to be in any common potential with other electronics, so it can work with simple two prong plug.
The earth connection (3rd prong) keeps you from being electrocuted if an electric appliance becomes damaged and then its metal chassis is accidently connected to the live electrical wire, and you touch the chassis and a grounded water tap. Modern electric appliances using only 2 wires have double insulation.