I have a rather bulky question.
In the 1700's, why did infantry stand in unprotected straight lines for the majority of battles? There must've been a less risky way to plug some people with lead.
Additionally, what did a lancer/uhlan do after they drove their lance into someone? Surely they couldn't remain behind enemy lines and draw their sabres, right? Did they turn tail and get new lances? Why did they even charge at musket-waving infantry anyway? Wouldn't that make them obvious targets?
For linear/line warfare, please look at the FAQ for many answers about it.
As for lancers, there are two things that happened. One, there was sometimes a leather strap where lancers would grip their lance that hand a grip, allowing them to pull it up and out of a body sometimes. However, most of the time they would charge, trot away and grab another lance, but usually lancers would just use their lance to smash into a battalion and then give them the steel with a sabre after their horses have already panicked a battalion.