So capital markets (cm) sits inside the investment banking division (IBD), and is private side - which means deal work, whereas global markets is sales and trading, which is sell side public.
What that means in terms of the work, is that investment banking (IB) and CM is more project M&A work. Technically CM and IB work together, but the difference between the two is in the type of work they do.
CM is made up of equity capital markets and debt capital markets. So by name, equity capital markets work on share buybacks, private selling on secondary markets, and debt capital markets is like bond issuances / auctions.
IB is more primary market, so advisory and capital raising.