I'll give it a try.
The pH can swing from day to night, due to a few reasons.
Plants ( algae ) in the tank take up carbon dioxide CO2 gas, that is in solution in the tankwater. They use this as part of photosynthesis, a process that converts CO2, water and light into a simple sugar, that these plants use as food.
When the lights are on, the plants consume more of this CO2 in the water than they do during the night when lights off.
CO2 in our saltwater tanks tends to form carbonic acid, which drives the pH down.
More CO2 in water = lower pH = night.
Less CO2 in water = higher pH = day.
These plants also give off oxygen gas as a result of photosynthesis - although O2 gas in solution does not affect the natural pH swings you are asking about, it does add oxygen to the water that the fish and aerobic bacteria need to live.
Most of the O2 gas comes from the surface of the tank water - but some is indeed produced by plants and alages.
Fish also produce CO2 gas in solution in our tankwater. They take in oxygen during "breathing" and give off CO2 as part of their natural respiration, just as we do when we breath air.
Higher amount of CO2 in the tankwater again leads to carbonic acid formation - and will lower the pH. Most fish are more active during the day than the night, although this is not always the case. Fish do indeed affect these swings in pH by altering the amount of CO2 gas in the tankwater.
Some of the bacteria in the tank also consume oxygen and give off CO2 during their activiteis too.
Inverts - all of them - require oxygen too. They too contribute to some degree the amounts of O2 and CO2 that is present in the tank - but normally to a much smaller degree that fish and plants do.
All of the above - plants/algae, fish, bacteria and inverts in the tank contribute to the swings in pH we all eventually experience, forcing a natural chemical reaction in the water.
It's a dance ..... production and consumption of oxygen, carbon dioxide, carbonic acid forming, these acids being neutralized by buffers ( carbonates and bicarbonates ) respiration of fish and bacteria and various gasses entering the tankwater from air/water interface at the surface, as well as trickle filters, powerheads, sump circulation, skimmers .... that all can and do affect the pH.
If you have a tank of saltwater with no fish, no algae and no bacteria - you would not see these natural swings in pH from day to night.
Adding marine pH or alkalinity buffers to a tank system will help reduce the range of these swings - but most often will not eliminate them. It's just a natural occurance that happens when the lights are either on or off.
One last note:
Having a refugium planted with marcro algae such as caulerpa, and having the lights on this refugium 24 hours a day, helps to eliminate some of the swings in pH from day to night.
Refugiums have been found to help "stabalize" the pH due to the 24/7 consumption of CO2 carbon dioxide gas in the water.
Less carbonic acid swings = less pH swings.
The pH changes from day to night cause the CO2 levels change from day to night, which leads to the carbonic acid levels changing from day to night - in a nutshell.