Just adding my 2 cents worth to the good responses already.
The practical use of PID for temperature control often has non-linear behaviors if the temeprature error detection is limited (op amp gain saturates output) and power available to control the temperature is fixed.
Consider an on-off controller. The system will have latency from the time when heat is applied and a change in temperature is detected. Which no PID loop, this latency creates an unstable loop oscillating and if there is any hystereis, the power cycles with noise (On-Off-On) However a very high gain ( such as a comparator ) results in a small residual temperature error. The latency affects the cycle time and overshoot.
If there was an external disturbance such as a tank lamp which may add significant heat, thne the heater regulator must respond as soon as a temperature rise is detected from the lamp heat. If your Lamp swith is not part of the PID loop , then it cannot "anticipate" the effect ( derivative feedback gain) Obviously, if the lamps generate too much heat then the temperature cannot be regulated and will exceed the setpoint.
Your heat control with PID control may have to have an inoput for Lamp switch state and output control to regulate the light power as a secondary source of heat, again if too much.
Defining your requirements for absolute control error, % overshoot and response time are some design inputs needed to optimize your PID loop. Equally important is defining your system disturbances and including them in your control system for input and output. eg. Lamp heat power and choice of sensor(s) and location.
Aside experience.
My 1st experience using a waterheater was during the water-bed era of the 70's when I was a student, I designed my own temp-controller using a thermistor, control circuit and a zero-crossing triac switch to the heater. I started with comparator control and found an unusual response from jumping in bed. So I added proportional control using unfiltered noise on the sensor to give me proportional "missing cycles" when the ZCS triac was ON near threshold. I could regulate the temperature within 0.1'C The response was softer but the result was the same.
I found the biggest error was in the location and tiny changes in water pressure on the sensor. ( I was tiny then, only 185 lbs but on a 2000 lb water bed <10% change in water pressure was tiny )
Thermal resistance between the sensor and the waterbed created a tiny offset error depending on the water pressure against the sensor. In your water tank scenario, the sensor error could be the effected by the size of tank and distance between sensor and heater or sensor and furthest surface of the water or the rate water flow or bubbles between the sensor and heater.
In my case whenever I jumped into bed the thermal resistance dropped slightly from added pressure and the power light would glow dimmer for a minute or two until a temperature dropped a tenth of a degree or to match the apparent temperature rise from additional weight and pressure of the waterbed against the thermostat.
(Lesson learnt. Do not neglect sources of distrurbances and their effects on Control System error)