Mr. Cake's great-great-great-great-great grandfather was a unicorn and Mrs. Cake's great-aunt's second cousin twice removed was a pegasus.
I can't believe I forgot that they explained that in the show. I had to re-watch the episode to refresh my memory. I usually pretty good at remembering stuff from TV shows. I even forgot that Applejack wonders the same thing.
Yeah, at the time I watched the episode, I found it hard to believe that 2 Earth ponies have pegasi and unicorns as ancestors (and I kind of still do).