An obligation (tungkulin) is a juridical necessity (pangangailangan) to give (magbigay), to do (gumawa), or not to do (hindi gumawa). Obligations arise from law (batas), contract (kasunduan), quasi-contract, delict (kasalanan), or quasi-delict.
On the other hand, a contract is a meeting of the minds whereby one person binds himself to give something or to render some service. So an obligation is more general than a contract.
In essence, obligations arise only from law and contract because the obligations from quasi-contracts, delicts, or quasi-delicts are derived from law. Don't worry, I will explain what these words mean.
First, we have obligations provided by law. For example, we should follow the law in the country, city, or municipality where we reside. We are also obliged to support our spouse, children, grandchildren, parents, and siblings. The most useful obligations provided by law are those found in the Constitution, Local Government Code, Civil Code, Family Code, Labor Code, National Internal Revenue Code (tax), and Revised Penal Code (crime).
Second, contracts are agreements made by persons who have freely entered into them. People may freely stipulate the terms and conditions in their contracts as long as they do not contradict the law, public policy, public order, and good customs. The agreement of the parties becomes the law between them.
There are many kinds of contracts: sale, lease, employment, carriage, insurance, partnership, agency, loan, deposit, guaranty, pledge, mortgage, incorporation, license, etc. The Civil Code governs many contracts. Other laws on contracts include the Labor Code, Insurance Code, Corporation Code, Intellectual Property Code, etc.
Third, a quasi-contract is where a person does a unilateral, voluntary, and licit act. The Civil Code gives two main kinds of quasi-contract: negotiorum gestio and solutio indebiti. The first situation is when a person manages a property or business in an emergency without the prior consent of the owner. The second situation is when a person finds something that does not belong to him.
Fourth, delicts are acts or offenses punished by law. In other words, they are crimes. We often hear the saying, "Crime does not pay." That's true because when you commit a crime, you must pay. You pay fines, damages, and other penalties. If you're unlucky, you're imprisoned.
Fifth, quasi-delicts are acts or omissions that cause damage to another, whether by fault or negligence. So these are less than crimes. For example, if you drive a car recklessly and bump into another car, you have to pay for the damage you made.
Of course, these are just the sources of obligations. There are more rules on how to meet your obligations and how contracts are understood. But the basic rule is to fulfill your obligations.