These were two different structures with different but related purposes.
The king's tomb was for his burial and the enclosure was for his Sed Festivals.
The enclosures would have contained shrines and buildings made of decayable materials.
With Djoser's complex the two were combined - mastabe tomb INSIDE the enclosure.
The enclosure structures were made in stone for the first time,
but their design mimicked earlier materials like logs and bundles of reeds.
Without any doubt Djoser's enclosure structures were for the purposes of the Sed Festival.
The original mastaba was first extended and later built over to create the Step Pyramid.
This complex became the model for later pyramid complexes which evolved.
But the dual functions of tomb and Sed Festival remained for all later pyramid complexes.