What these suffixes do
The suffixes -ary and -ory are variants of the same Latin origin. They create two types of words:
1. Adjectives meaning "relating to" or "of the type of": primary, ordinary, necessary, mandatory.
2. Nouns naming places or collections: laboratory, dictionary, library, factory, dormitory.
This is a very frequent suffix in academic and formal vocabulary.
The Spanish cognate: -ary/-ory = -ario/-orio
Spanish uses -ario/-orio with the same root, and cognates are plentiful:
dictionary = diccionario
laboratory = laboratorio
dormitory = dormitorio
obligatory = obligatorio
If Spanish ends in -ario or -orio, the English version almost always ends in -ary or -ory.
Stress shifts forward
An important difference from Spanish: in English the stress moves toward the beginning of the word, and the final -ary/-ory is reduced.
Spanish: dic-cio-NA-rio (stress on 3rd syllable)
English: DIC-tion-ary (stress on 1st syllable, -ary is a quick "er-ee")
laboratory: la-BOR-a-to-ry (EN) vs la-bo-ra-TO-rio (ES)
In American English one syllable is sometimes dropped: LAB-ra-tor-ee.