"Opened up an old motor I acquired at a garage sale, took this part off the top and there’s a sponge and some wires inside. Why is there a sponge inside?"
A: "The cover is for the start or run capacitor, foam is probably just to stop it from rattling. (cap will be behind the foam, in the tub in your hand)."
For you younger guys. Dating was much more fun before pantyhose.
It is used to keep the pistons from the disk brake caliper separated when the wheel is removed in case the brake lever is pushed accidentally.
It's from Adafruit, the company famous for their DD8008S and attempted takeover of Apple... so everything else is obvious.