https://ultimateclassicrock.com/u2-mysterious-ways/
Those two seemingly opposite vibes harsh guitar tones and club-friendly beats became the foundation of Mysterious Ways. U2 first started tinkering with the track at Dublins STS Studios, building on an improvisation they called Sick Puppy, with the Edge, singer Bono and bassist Adam Clayton jamming over a beat box pattern. They knew it had a central riff worth developing: Claytons primal bass groove, which previously emerged while recording their 1990 charity cover of Cole Porters jazz-pop tune Night and Day. But nothing else seemed to stick.
Mysterious Ways was a bass line in search of a song, singer Bono wrote in the bands 2006 autobiography, U2 by U2. But it was never much more than a one-note groove for a long time. However, as with so many of their previous songs, the Edge lifted the idea by messing around with unusual guitar effects.
Edge got a new pedal he was playing around with, making this envelope of sound which would turn a guitar chord into the funkiest of jackhammers, Bono added. I heard it from another room and ran in. I said, Whats that sound? He said, I dont know, Ive just come up with it. I said, We need it for Mysterious Ways.
-snip-
Of course, they eventually got there: Edge landed on a more fleshed-out chord sequence; drummer Larry Mullen Jr. added in a live drum kit; and Bono arrived at a euphoric vocal melody, accentuated with a childlike cadence, and lyrics about a man living on little or no romance. (It was the Edges idea to add the its all right line, reasoning that, well, theyd never used that phrase before.) The end product added up to what Bono described as U2 at our funkiest.