It matters where ishvarapranidhana sits: last. The niyamas run purity, contentment, austerity, study, surrender, and the sequence reads as a deliberate education in the limits of effort. Purity, contentment and austerity are things a practitioner does; study begins the turn outward, placing the mind under a text it did not write; surrender completes the turn, giving the whole enterprise away. The tradition is candid that this final observance corrects a hazard the first four create. Discipline succeeds, and its successes accrue to the ego: the pure become proud of their purity, the austere collect their austerities like medals, the learned weaponize their learning. Yoga's literature is full of accomplished ascetics ruined at exactly this point, their powers intact and their liberation receding.
Ishvarapranidhana is the structural answer: practice dedicated, from the start, to something that cannot be flattered, with the fruits explicitly renounced. Patanjali attaches to it the highest fruit in the list, samadhi itself, and at sutra 2.45 the wording is significant: samadhi-siddhih, the perfection of samadhi, comes from surrender to the Lord. The absorption the entire eight-limbed apparatus labors toward is delivered, in the end, by letting go, and the commentators draw the obvious moral: effort builds the path, but the last step onto it is not a grasp, it is a release. In that sense the fifth niyama is not one observance among five; it is the posture in which the other four stop being achievements and become offerings.