Since you didn't provide a picture, or a very helpful description of what you're looking at. I'll try answering your question by explaining how the switch itself works, which will hopefully help you understand the problem better.
Single Pole Single Throw (SPST) Pull Chain Switch
The pull chain switch that controls the light(s), is a single pole single throw (SPST) switch. It has two positions ON (Closed), and OFF (Open). Drawn simply, it would look something like this.
![Quarter turn switch (Closed)](https://i.stack.imgur.com/KfmZ7.png)
Switch shown in ON (Closed) position.
When the switch is in the ON (Closed) position, current is allowed to flow through the switch, through the light(s), and back to the the source (via neutral).
![Switch Closed Current flows](https://i.stack.imgur.com/GaAkb.png)
When the chain is pulled and released, the internal contact rotates 90° (1/4 turn) into the OFF (Open) position.
![Quarter turn switch (Open)](https://i.stack.imgur.com/u7E3N.png)
When the switch is in this position, current is not allowed to flow through the switch, and the light is not lit.
![[Switch Open Current does not flow](https://i.stack.imgur.com/2oXXC.png)
This is why the pull chain switch that controls the light(s) only has two leads.
Single Pole Multiple Throw (SPnT) Pull Chain Switch
The pull chain switch that controls the fan, is a single pole multiple throw switch. It has multiple positions, which allows it to control the speed of the fan. Draw simply, it would look something like this.
![enter image description here](https://i.stack.imgur.com/r2bCG.png)
Switch shown in OFF (Open) position.
When the chain is pulled and released on this switch, the internal contact rotates 45° (1/8 turn) to the next position.
![enter image description here](https://i.stack.imgur.com/3r5la.png)
Another pull, another turn.
![enter image description here](https://i.stack.imgur.com/rPFM6.png)
Pull again, turn some more.
![enter image description here](https://i.stack.imgur.com/XJ3Fv.png)
One final pull brings the switch 180° around, and again to the OFF (Open) position.
By manipulating the output of this switch, the fan is able to whirl around at various speeds depending on the switches position. The number of output leads, will depend on the switch. How those leads are connected to the fan motor, will depend on the fan manufacturer. This simply illustrates the basic principle of how the switch works.
As always electrical work can be dangerous, never be afraid to contact a qualified Electrician
Another thing that seriously needs to get corrected is the totally unacceptable workmanship of the wire attachment at the switches. The wire insulation should be right up at the screw head. The tail end of the wire should only extend out from under the screw heads by a very small amount.
![enter image description here](https://i.stack.imgur.com/6Fez6.png)
![enter image description here](https://i.stack.imgur.com/7ubQT.png)
![enter image description here](https://i.stack.imgur.com/oyl8d.png)
![enter image description here](https://i.stack.imgur.com/ivJFF.png)
If this wiring was prepared by someone that you paid to do the work you should take proper recourse to get them back to correct this extremely shoddy work.
If you have no recourse then you owe it to yourself, for safety and peace of mind, to get this mess cleaned up.
Best Answer
It looks like you have a switch loop so you need to take your always hot black wire and connect it to the white wire with the black markings (can you read the markings). Put some black tape on that white wire to show it's always hot. Hook your fan up to the remaining two wires. Put some black tape on the white wire at the switch box too. Leave the ground from the fan unhooked since you don't have ground there.
Now for the bad news. I doubt that that ceiling box it rated for a ceiling fan and it needs to be changed out. While the box could be firmly mounted to the joists, the threads and screws you use to attach the fan to the box are not strong enough. If you have attic access, changing out the box won't be too bad but if you don't, You might have to remove some of the ceiling to replace the box.