Generally speaking, switches behave like a hub when their CAM table overflows. I'll try to find some Juniper-specific documentation to prove this, but my recollection is that in the event of a CAM table overflow, the switch floods all frames out ports belonging to the same VLAN. , but I want to check on this.
In case you don't have this, here's Juniper's documentation on CAM overflow protection: https://www.juniper.net/documentation/en_US/junos/topics/example/port-security-protect-from-switching-table-overflow-attack.html
Specifically, you want to limit how many MAC addresses can be learned on a single interface. This is typically done on access ports.