From DND Beyond entry on Black Pudding: (bold italics are mine)
Damage Immunities acid, cold, lightning, slashing
At the bottom of the stat block, under Reactions, it has the ability Split:
Split When a pudding that is Medium or larger is subjected to lightning or slashing damage, it splits into two new puddings if it has at least 10 hit points.
If it's immune to lightning and slashing damage, how can it be 'subjected' to lightning or slashing damage in order to activate 'Split'? It's clear that 'is subjected to' means that it takes the damage. If you're immune to something you by definition cannot be 'subjected' to it.