Margin has multiple meanings "in finance". There is a speculation context and a business context.
In the speculation context, margin refers to collateralized borrowing to trade with larger amounts than you have deposited, potentially amplifying your risk or in potentially mitigating risk. Your first definition was referring to this but giving a short definition about the "sum" (the collateral) deposited with a broker.
In the business context, margin refers to the difference between what you spend to do business, and what you earned. If it cost you $10 in gas to transport a crop across town to sell the crop for $15, your margin would be $5. What does "profit margin" mean? It means the $5, its the same as saying "my margin is $5", and in further deeper contexts like accounting and tax you would differentiate between gross margin and net margin. But in colloquial speech with people about running a business selling goods and services, margin and profit margin and profit are synonyms.