According to witnesses, El Chapo heavily invested in wiretapping and spyware equipment over the decades, becoming obsessed with secure communications in the 1980s. Around that time, he also began obsessively recording the calls of his wife, lovers, associates and enemies. One associate, Miguel Angel Martínez, recalled Chapo telling him, “The most important thing in that environment was to know what everyone was thinking about you. Whoever — your friends, our enemies, your compadres.”

Later, Christian Rodriguez, a 20-something I.T. expert from Colombia, developed a more high-tech spyware system for phones and computers belonging to Mr. Guzmán’s wife, mistresses and associates. Mr. Guzmán received routine spy reports and also made a habit of calling back associates after a business transaction; the second, invisible, call activated hidden microphones that enabled him to listen in without the person’s knowledge.

The United States government used El Chapo’s intrepid spy systems against him. Although Mr. Guzmán used BlackBerry phones as well as a filter system, which passed messages between third parties to protect the identity of the senders, his most comprehensive system was devised by Mr. Rodriguez. It allowed him to place calls from a secure three-digit extension to other trusted parties anywhere in the world.

However, Mr. Rodriguez agreed to cooperate with American authorities after being approached by the F.B.I. during a sting operation. He turned over calls and text messages from the encrypted system.

The prosecution’s case was built from four wiretap investigations. In addition to Mr. Rodriguez’s system tap, prosecutors also used wiretaps collected by authorities in Colombia and the Dominican Republic, as well as one from Homeland Security Investigations.

The government collected more than one million text messages between cartel members.

Like any good business, the Sinaloa cartel globalized, stretching far beyond the Mexican-United States border to Colombia, Ecuador, Panama, Belize, Honduras, Canada, Thailand and China.

From early in his career, Mr. Guzmán reached out to cocaine suppliers in Colombia to receive cheap cocaine. He negotiated cheaper deals with the dealers by promising to deliver the cocaine more quickly, gaining him the nickname El Rápido for his speed in funneling the cocaine through tunnels under the border.