‘Let his heart be changed from man's and a beast's heart be given unto him’ – nothing literally happened to his heart. The heart here seems to indicate, in line with the rest of it, his thinking, his mind.
How quickly success in life can go to our heads! The king says, ‘I am number one. No one put me here. I won it by my strategy on the battlefield. It is my accomplishment.’ ‘No,’ says God, ‘I do it and I allow even the basest of men to rule. It doesn’t even depend on qualities.’ We too soon attribute all that we gain to our own skill and prowess, instead of seeing all that we have as the gift of God. We must constantly beat down our pride and remind ourselves that we are unworthy to receive any gifts from the Lord. Any value that the Lord puts on us is the result of his grace, what he has made us. We must thank him continually and sincerely for that, and this will help cure us of boasting.