When a loan or grant is made to a homebuyer it is usual for the property to act as security for the loan. A Standard Security is used to detail the terms and is registered with the property's title deeds. A property can't be sold by law without those holding a security being informed and reimbursed.
Whilst there is a standard form of security in Scotland, it can be changed to incorporate different conditions, such as those attached to a grant. Viewing a sample Deed of Variation of Conditions may be useful.
The order of securities is very important and can cause considerable problems. Mortgage lenders will only agree to lend if they have the first security. The Government will only agree to grant if it has the second security. All other lenders must take positions after this.
A Ranking Agreement can be used to agree the order of securities regardless of the date on which they were registered. This is, however, a very unusual process for solicitors and almost always causes delays. All parties holding a security, as well as the loan or grant recipient, must sign the Ranking Agreement. Since mortgage lenders are unaffected by it, as they hold the first security, they are often the slowest to sign.
Viewing a sample Ranking Agreement may be useful

Resources
Information