PID is a control loop algorithm: something which takes a desired value and an actual value from a sensor, and outputs something to some kind of actuator to try and get the actual value to match the desired value.
A simple example of a control loop algorithm is the "bang-bang" algorithm used by your thermostat. When it's too cold the furnace turns on, and when it's too hot the furnace turns off.
PID was discovered by observing boat helmspeople. It was observed that there are three major factors in their decision of how to turn the boat's wheel (the P, I, and D respectively).
First, they set the wheel to approximately where they think it needs to be to achieve the desired angle. That's the P, or proportional part.
Then they note the cumulative error over time, i.e. the distance away from the desired angle summed up over each moment that they are still waiting. As the cumulative error rises, they turn the wheel a bit further to compensate. This is the I, or integral term, which accommodates conditions where the controls are particularly dull, causing the proportional control to undershoot.
Finally they observe the rate at which they are approaching the desired angle and compensate negatively if they are approaching it more quickly than they expected. This is the D (derivative) term, which accommodates conditions where the controls are particularly sensitive and the proportional control overshoots.
PID just adds these three terms together with weights chosen for the specific application. Choosing those weights is the tuning process.