The meaning is interchangeable in some contexts but not always. Pomyłka/mistake implies that an error was made; whereas przypadek/accident only implies that the result wasn't intended and/or expected, and random chance was involved.
I.e.: Odkryłam to przez przypadek / I discovered it by accident.
Ehh, they're different. Chance implies... man, this is hard, but believe me, they are different. "By accident" means you had no intention of doing it, the unintended outcome is neither good nor bad. It might even tend towards bad. Chance implies that it was... lucky? Like, you didn't really mean to, but, thankfully, you did. Hope that helps.
I get a free paper, Anonse, from a local Polish centre, and it has many adverts offering help to people who have had accidents: "Miałeś Wypadek Drogowy? Pomożemy Ci!" The full list is "Wypadki samochodowe, pieszych i rowerzystów, taksówkarzy, w pracy, w miejscach publiczynch". And that is from just one advertiser.
I see a common root with the verb "to fall" = "padać"; an accident is something that "befalls" you, in somewhat old-fashioned English.
Another "native speaker" here from the US who can confirm that yes, the idiot millennials have made "on accident" a thing. It probably came about due to their limited vocabulary, inexperienced as they are with reading books instead of crap on social media, and their casual approach to all things grammar and spelling. They learned "on purpose" and assumed "on accident" would work equally well. Now, this ridiculously incorrect usage is widely accepted.