I don't really understand what you mean by 'how do mortgages work'.
A house is for sale, if you pay a deposit of half the value, the bank will lend you other other half to enable you to buy it. You will pay interest on this loan and make monthly repayments for a set number of years until it is repaid.
You can usually borrow around 3.5 times your annual income (although this varies between lenders) so for example, if you are looking for a mortgage of 100K and only earn 10K, you would have no chance - you would need to earn about 28K to get a mortgage of that size.
You will usually be able to lend the money at a better rate of interest if you have a larger deposit.