Also called a solar battery regulator, a solar charge controller moderates the flow of electricity between the solar array, the battery, and the load. The controller ensures the battery is full without over-charging.
When the battery is full, the solar panel charge controller stops the flow of electricity from the solar array, or diverts the energy (for example, to an electric water heater). Once the batteries are full, the charge controller will send the excess power not being used to a dump load, or out through the inverter and onto the grid if the system is grid-connected.
The cost of a charge controller depends on the size of your solar electricity system and the monitoring features you choose.