There are 3 reasons to wear weightlifting shoes:
The lifted heel effectively increases ankle range of motion, allowing a deeper and more upright squat position.
The thin, hard soles absorb very little force, which means more of the force you produce goes into moving the bar.
The relatively wide, square-edged and hard soles create a more stable base.
These things mean lifting more weight and less risk of injury.