First of all, what happened to the humans?
Most of them died, as seen in “Her Parents”. Humans are almost extinct, and Finn never found another human. Some humans mutated; in “The Other Tarts” a bunch of zombies attack Finn in a cave, and in “Susan Strong”, Finn found a bunker (most likely a nuclear bunker) that had humanlike characteristics but fish-like gills and heads. The race was dubbed “the Hyoomens”.
Finn came from the bunker, since he was found in the forest; humans are a rare species in Ooo. All the tribe wears animal themed hats; this could be the symbol of the tribe, explaining why Finn could have his hat. But then how did Finn get to the surface and why was he taken there?
He was obviously not taken there by his tribe, seeing how all the Hyoomens were afraid of grass; I conclude it was their first time on the surface.
I think he was then expelled from his tribe because he was not a “fish person” like the other Hyoomens. Unlike his family, he was born a full human, possibly a disease of a non-Hyoomen baby being born of a Hyoomen.
From here, I have two theories.
First is that the tribe tried to kill Finn since he was not a Hyoomen, (they did not try to kill Finn in Susan Strong because of his hat, and they though he was a Hyoomen), but his mother took him and ran to the surface. Scared of the light, the tribe did not follow. What happens after that is a mystery.
The second theory is that they drown all the kids born as humans (something to do with being a Hyoomen, or something to do with traditions is my guess why.)
Finn floated to the outside of the bunker though a crack in the earth wall. This was a perilous journey, what with the Hyoomens and being underground and everything, so this would explain Finn’s fear the sea (it’s like the large underground river.)
After that, everything is pretty simple; the story is stated in the episodes. Finn was found in the forest by Jake’s parents, and was raised by them. Finn later moved out with Jake and came to live in the tree house.
What about magic?
It seems that magic always existed in Ooo. In the episode “The Chamber of Frozen Blades”, Finn finds a ninja book from before the war. In it, he learns techniques very similar to the Ice King’s powers (which were bestowed upon him from the magic crown). Magic powers may have come about after all technology had been destroyed and living things were more connected with the forces of nature.