It was intended to resolve the dispute that had been created following the return of Christopher Columbus. In 1481 the papal Bull Aeterni regis had granted all land south of the Canary Islands to Portugal. In May 1493 The Spanish born Pope Alexander VI decreed in the Bull Inter caetera that all lands west of a meridian only 100 leagues west of the Cape Verde Islands should belong to Spain while new lands discovered east of that line would belong to Portugal, although territory already under Christian rule would remain untouched. Naturally the Portuguese King John II was not happy, so he opened negotiations with King Ferdinand and Queen Isabella of Spain to move the line to the west, arguing that the meridian would extend all around the globe - limiting Spanish control in Asia. The treaty effectively countered the bull of Alexander VI but it was sanctioned by Pope Julius II in a new bull of 1506.
Very little of the newly divided area had actually been seen, as it was divided according to the treaty. Spain gained lands including all the Americas. Brazil, when it was discovered in 1500 by Pedro Alvarez Cabral, was granted to Portugal. Although the line extended into Asia, at the time accurate measurements of longitude was impossible so uncertainties arose. The line was not strictly enforced - the Spanish did not resist the Portuguese expansion of Brazil across the meridian.
The remaining exploring nations of Europe such as France, England, and the Netherlands were explicitly refused access to the new lands, leaving them only options like piracy, unless they (as they did later) rejected the papal authority to divide undiscovered countries. The view taken by the rulers of these nations is epitomised by the quotation attributed to Francis I of France demanding to be shown the clause in Adam's will excluding his authority from the New World.
With the voyage around the globe of Magellan, a new dispute was born. Although both countries agreed that the line should be considered to be running around the globe, dividing the world in two equal halves, it was not clear where the line should be drawn on the other side of the world. In particular, both countries claimed that the Moluccas (important as a source of spices) lay in their half of the world. After new negotiations, the Treaty of Saragossa of April 22, 1529 decided that the line should lay 297.5 leagues west of the Moluccas. Spain got a monetary compensation in return.