Yes, not only space, but also limited hardware. U5 was the last Ultima that still ran on 64kb of memory -- of course with several floppy discs to swap (a second floppy drive was a big advantage for that game) -- I think, there where 6 or 8 of them, but you had to swap mainly two (overworld and town disc).
It was the genius of that time, that a game of that size could fit into such limited hardware (64kB RAM, no HDD, only Floppy drives with 180kB size limit, <1MHz clock with unbelievable slow 8bit processor (I guess, today they sell such stuff as a smartcard "SOC" -- but of course with out the Floppy drive -- even the processors on SD-Cards are faster today, I guess) [Specs from the C64 version, but there existed versions at least also for Apple II with similar specs (It could even be, that it ran on Apple II with only 48kB) -- and (later?) of course for IBM PC].
U4 was technically similar to U5 (also several discs to swap and a big world on limited RAM), U5 did just drove the concept to the technical (and swapping-endurance-) limits. I think, they doubled the disc number (and so the content, I think 4->8 discs), improved the combat system (I liked the U5 combat system the most from all Ultimas I know) and made a new story, that showed the other side of "righteous" living.
Even, when I never found the time, to finish U5, for me it is still the best of all time.