You take units (subjects) to earn credit points.
To complete a degree, you must fulfill the credit point requirements for that degree, say 96 overall.
If you take a unit worth 3 credit points and pass that unit, those 3 credit points will contribute towards the 96 you need to earn overall to complete the degree. If you fail, you do not earn the 3 credit points.
Credit point systems differ between universities, at one university a unit may be worth 3 credit points each, at another it may be worth 6.