Charge controller is a device that regulates the supply of current and/or voltage to a battery or battery bank, also known as charge regulator because of its regulating function. It regulates the voltage and current from solar panels to store in the battery. MPPT (Maximum Power Point Tracking) type of solar charge controllers are now industry standard which have made it possible to make large arrays of solar panels and get the maximum power extracted from them.
The other purpose of charge controllers is to protect the expensive asset (battery section) in a Solar system; though you can connect a Solar Panel output directly to the battery but that will cost in two ways – loss of energy harvesting & early replacement of battery part. Technically speaking, every kind of battery, because of its internal structure and characteristics, specifies some precise sum of voltage and current while being charged (or discharged) – there are design limits. A Solar Panel is a unidirectional source of energy which generates and supply DC electric power at its given voltage and current rating while battery is a bidirectional energy device which can accept and deliver energy. An intermediate device is required to manage the transfer of energy from one source (Solar Panel here) to the other source (the battery) in order to protect the design limits of battery (or battery bank) and ensure energy transfer efficiency.