a chairman usually is just an officer who leads a group to do their business, like during a meeting, the chairman will probably be the one to organize what the meeting is about, what is the goal, etc. also chairmen are only positions in a specific group, a group that is usually a part of a larger group, and their authority only belongs to that group. For example, the PTA in a school usually has a chairman. Although this group is officially a part of the school and is very important, the chairman of the PTA has no power over the school like the president of the school would.
while a president usually is the one in charge of making sure everything is doing their job and doing it properly, and sometimes also be a leader for the whole company or group, to give inspiration to the employees.
although these are the common definitions of these roles, it also depends on the company or group you are talking about. these are just titles so they can have different meanings in different places.