Meanings
to/for oneself (alone, not directed at anyone else)
Er singt leise vor sich hin.He’s singing quietly to himself.
slowly but steadily, without being bothered or interrupted by anyone
Sie arbeiten so vor sich hin.They’re working slowly without being bothered.