It’s not really a secret. They have cheap labor. Very lax environmental standards (big deal for PCB manufacturing). They have a high density of manufacturing and production. One factory can get their materials and machines from other factories nearby. Their government manipulates exchange rates.
People are also quick to forget US companies that serve these same markets. OSH Park was doing cheap PCB panel share before JLCPCB was a common name. Boards manufactured right in the United States. They don’t have the volume of JLCPCB but they’ve been doing cheap boards for hobbyists for a long time: https://docs.oshpark.com/services/