Presumably that cable goes to the fan isolator. The other cable from the fan isolator hopefully goes either to the light or to the switch where you can see what is connected to what. Turn the power off and look inside, and post photos.
The wiring in the fan isolator might give a clue, but you...