1660s, "in some way not yet known," from some + how. First attested in phrase somehow or other.
they managed somehow
he expected somehow to discover a woman who would love him
he had me dead to rights but somehow I got away with it
It doesn't seem fair somehow