This refers an action performed to achieve some result, without any understanding of the mechanics of how it works, or even if it does work. But Action X is mentally associated with Result Y, and someone believes the causation exists, so they keep performing Action X.
A literal “cargo cult” originated in Melanesia, during World War II. From Wikipedia:
Isolated and pre-industrial island cultures that were lacking technology found soldiers and supplies arriving in large numbers, often by airdrop. The soldiers would trade with the islanders. After the war, the soldiers departed. Cargo cults arose, attempting to imitate the behaviors of the soldiers, thinking that this would cause the soldiers and their cargo to return. Some cult behaviors involved mimicking the day-to-day activities and dress styles of soldiers, such as performing parade ground drills with wooden or salvaged rifles
The islanders continued performing Action X (acting like soldiers) in the hope that it would cause Result Y (delivering of cargo and goods), without understanding that the actual cause was a global war which gave a foreign military a reason to inhabit their island. Their view of the world was too limited to understand the bigger picture.
Today, the phrase is used often in business and IT.
“Cargo cult programming” is when a novice programmer includes some more sophisticated code or module because they have seen more senior programmers using it, and they believe it provides Benefit Y. However, they don’t understand how or why it works. Often, the actual cause of Benefit Y is something completely different to which the novice programmer remains oblivious.
This can be expanded to general business strategy and operations. Many executives will see someone more successful or that they admire perform Action X, and believe it will deliver Result Y, so they implement a policy or practice at their organization, with no underlying understanding of why it worked in the first place.