A notary is a person authorised to perform acts in legal affairs, in particular witnessing signatures on documents. The form that the notarial profession takes varies with local legal systems.
A notary, while a legal professional, is distinct from an advocate in that they do not represent the person who engages their services, or act in contentious matters.
The Worshipful Company of Scriveners use an old English term for a notary, and are an association of notaries practising in central London since 1373.
Documents are notarized to deter fraud and to ensure they are properly executed. An impartial witness (the notary) identifies signers to screen out impostors and to make sure they have entered into agreements knowingly and willingly. Loan documents including deeds, affidavits, contracts, and powers of attorney are very common documents needing notarization.
Code of Hammurabi Law 122 (c. 1755–1750 BCE) stipulated that a depositor of gold, silver, or other chattel/movable property for safekeeping must present all articles and a signed contract of bailment to a notary before depositing the articles with a banker, and Law 123 stipulated that a banker was discharged of any liability from a contract of bailment if the notary denied the existence of the contract. Law 124 stipulated that a depositor with a notarized contract of bailment was entitled to redeem the entire value of their deposit.
To "notarize" a document or event is not a term of art, and its definition varies from place to place; but it generally means the performance by a notary of a series of possible steps, which may include the following (not an exhaustive list):
Most common law systems have what is called in the United States a notary public, a public official who notarizes legal documents and who can also administer and take oaths and affirmations, among other tasks. Although notaries public are public officials, they are not paid by the government; they may obtain income by charging fees, provide free services in connection with other employment (for example, bank employees), or provide free services for the public good. In the US (except Puerto Rico), any person – lawyer or otherwise – may be commissioned as a notary.
Most civil law-based systems (including Puerto Rico and Quebec) have the civil law notary, a legal professional performing many more functions than a common-law notary public. They are qualified lawyers who provide many of the same services as common-law attorneys/solicitors (negotiation and drafting of contracts, legal advice, settlement of estates, creation of a company and its status, writing of wills and power of attorney, interpretation of the law, mediation, etc.) except any involvement in disputes to be presented before a court. 
In the United States, a signing agent, also known as a loan signing agent, is a notary public who specializes in notarizing mortgage and real estate documents.
Notaries in civil law jurisdictions are specialized in all matters relating to real estate, completing title exams in order to confirm the ownership of the property, the existence of any encumbrances such as easements or mortgages and hypothecs.
Often, in the case of lawyer notaries, the certificate to be provided will not require the person appearing to sign. Examples are: certificates authenticating copies (which are mostly not within the permissible functions of U.S. notaries) and certificates as to law, such as certificates as to the capacity of a company to perform certain acts, or explaining probate law in the place.
In the United States, many states including Virginia, Texas, Ohio, and Nevada have passed laws allowing for online witness by notaries, using screen sharing or webcams as well as identity verification processes. To comply with state law, notaries must be located in any of the states that have authorized remote notarization services. Virginia was the first state to pass legislation allowing online notarization in 2012. Texas and Nevada passed similar laws in 2017 that went into effect in July 2018. In the United States as of 2017 there are estimated to be over 4 million notaries.
122. If anyone entrusts to ... article in undiminished quantity.
§122. If a man give ... disputed and repay it.