Most likely it is one of two optional connections. One is for the fuel solenoid on the carburetor if equiped and the other is for an option hour meter.
If your has the fuel solenoid on the carburetor. While the mower is running disconnect one of battery leads. It probably will die which would indicate that the stator (alternator) is not working.