The chain starts with a page the victim trusts: a legitimate site that got compromised, one boosted to the top of search results through SEO poisoning, or an ad slot serving malvertising. Injected JavaScript fingerprints the browser and OS, then either fires an exploit against a vulnerable plugin or renders a fake dialog, most commonly a browser update prompt styled to match the vendor. SocGholish, the campaign Red Canary and MITRE both document most thoroughly, favours the second path: it never needs a zero-day, it just needs the user to click 'update'.
Where drive-by compromise separates itself from simple social-engineering downloads is what happens next inside the process tree. A successful exploit hands the attacker code execution directly; a fake-update lure hands the JavaScript payload to the Windows Script Host, so the browser process becomes the direct parent of wscript.exe or cscript.exe running a .js file dropped to a temp directory. That parent-child relationship, browser to script host, is unusual enough on its own to anchor a detection, because browsers do not normally download a script and execute it themselves.
Once the script runs, the intrusion moves fast and mostly in memory. SocGholish's JavaScript performs system, software, and process discovery (whoami, listing installed AV, enumerating running processes), stages what it finds locally, and phones home over HTTP POST requests disguised as ordinary web traffic. The pivot into domain reconnaissance, nltest.exe with /domain_trusts or /all_trusts, is the signal that the infection is being handed off for further exploitation rather than left dormant.