What are the mechanics behind the 1.14.4 AFK fishing farm?

Fish farms use a carefully balanced system of blocks. The water that you look at is at exactly the right level that the fishing bobber just barely triggers a tripwire above the water. When a fish bites, the bobber not only visually moves down, it actually does move downwards and un-triggers the tripwire.
That opens the trapdoor that is otherwise closed in front of you, making your constant clicks no longer be trapdoor clicks, but instead fishing rod clicks, so you reel it in, which automatically catches the fish, and cast it out again, which triggers the tripwire again.

Note that this type of farm no longer produces overpowered end-game loot in 1.16, because there you need to actually fish in open water to be able to catch treasure loot. You can still get tons of fish with the classic fish farms, you can still get treasure loot from fishing manually and you can still get all kinds of loot in newly designed "open water" fish farms, but those do not use tripwires, so they are very slow (all intended for game balancing). Getting over-powered end-game items is also still possible, by actually proceeding in and playing the game normally.