The spear was in fact, according to the canon junior novelisation, an electro-spear. It delivered a jolt into the jetpack's controls, shorting them and activating the jets.
But dumb luck? That’s where Solo has always excelled.
The electro-spear hits Boba Fett in the back, sending a wallop of electricity into his jet pack. It ignites instantly.
Boba rockets through the air. He grabs uselessly at the short-circuited controls of the rocket. He has just enough time to think of how silly he must look before he slams into the side of the sail barge and then falls, arms flailing, past the skiffs, past Lando, past the tentacles and the teeth…and into the belly of the Sarlacc.
Star Wars: Return of the Jedi - Beware the Power of the Dark Side!
Interestingly, this conflicts with earlier sources of information about the reason for the ignition, placing this firmly as a result of the impact of the spear on the jetpack.
The space pirate turns around blindly, and the long spear in his hand
whacks squarely in the middle of Boba's rocket pack.
The impact of the swing causes the rocket pack to ignite. Boba blasts
off, flying over the second skiff like a missile, smashing against the
side of the huge Sail Barge and sliding away into the pit.
Return of the Jedi - Screenplay
Chewie barked frantically. Han swung his spear again, this time in the opposite direction, landing the hit squarely in the middle of Boba’s rocket pack. The impact caused the rocket to ignite. Boba blasted off unexpectedly, shooting over the second skiff like a missile and ricocheting straight down into the pit.
Return of the Jedi: Official Novelisation
Apparently this was a known flaw in the Z-6 Jetpack.
Their significant disadvantage was their vulnerability to external impact damage. One sharp blow with a stick could conceivably ignite the jetpack, causing all manner of unwanted performance that could lead to significant bodily harm or even death.
Star Wars Databank: Z-6 Jetpack
You might note that the jetpack itself is not (presumably) made of beskar. It's a production model which would suggest that it's a less sturdy metal