What is this thing that goes near the ignition coil?

Theres some wires and connectors that go into the ignition coil area on my Mazda 626. I have included a youtube video of the “connector” in question. I thought my coils were bad so I decided to replace it and while I was fiddling with it I saw this piece that looks broken.