i before a vowel to y

Any vowel that had the value [i] or [e] when stressed and occurring before another vowel (e.g., a sequence [ía] or [éa] or [íu] or the like) underwent a complex change (or series of a couple of changes) resulting in the shifting rightward of the stress and the development of i/e to a “glide” consonant pronounced “y” ([j] in the International Phonetic Alphabet).

For instance, earlier Greek παιδία paidía ‘children’ developed into modern Greek παιδιά peðyá (with other changes in the diphthong αι/ai and the consonant δ/d).

This change (or set of changes) helps to explain the shift seen in the difference between the nominative δωμάτιο ðomátio ‘room’ (with accent on the non-final syllable -μa-) and the genitive δωματιού ðomatyú (with accent on the final syllable) especially if one is aware of the ancient Greek accentuation rules that would shift an accent on a nonfinal syllable one syllable to the right (towards the end of the word) when the final syllable is long.  That is, the genitive was originally δωματίου ðomαtíū (remember that < ου > was originally long ) with the nominative accent (δωμάτιον ðomátion) shifted rightward one syllable, and then the change of í + unaccented vowel to y + accented vowel applied, giving δωματιού ðomatyú.

This development, which as far as Modern Greek is concerned is completely unmotivated and is an extra detail one needs to learn with relatively common nouns like δωμάτιο ðomátio ‘room’ or σπίτι spíti ‘house’, makes sense to a classicist, who would know the ancient Greek accentuation rules, once you know sound change affecting í + vowel.