Michael did not ‘wait’ 21 days. This is an inference. The situation is clear. Daniel was in a land which had had been assigned to another ‘god’. (Sons of God/Deut 32).
Israel was ‘in’, therefore ‘under’ another nation. (And their god(s)). The prince of Persia (angel/son of God) had a ‘right’, every right to resist the angel trying to get through to Daniel. And, there is clearly both a hierarchy, and a ‘difference in might’ amongst angelic beings. (e.g. Rev 12).
All of this is clearly explained biblically, so no need to speculate. The only issue is does [or can] this view ‘fit’ your accepted theology - for some, particularly if it is ‘traditional - it possibly won’t. So this answer will not suit all.
..... [cont] Further to this, the delay was due to the struggle [in the heavenly realm]. I have explained the reason for the delay. Revelation 12 also talks about an angelic encounter ...
REV 12:7 And war broke out in heaven: Michael and his angels fought with the dragon; and the dragon and his angels fought, 8 but they did not prevail,[snip]
Note, this ‘struggle’ was not ‘instant’ - and so it was in Daniels case. The prince of Persia would have been a formidable foe, hence the intervention of Michael.
It is unlikely that Daniels prayer and fasting had any impact, as the angel clearly said the answer was dispatched as soon as Daniel asked. If you ‘think’ that Daniels prayer and fasting made ‘the/a’ difference, and can substantiate that, I’d be interested. The New Testament clearly talks about praying, then believing you receive..... that is, the ‘manifestation’ may not be ‘instant’.
As for why the period was 21 days? I have no idea. This answer explains the reason for the delay, and, specifically that it was not Michael waiting. I suspect that angels are ‘busy’ with their roles, and they are not omniscient, nor omnipresent. The first angel was certainly ‘engaged’ (at the start.).