Pony ex machina.
There was no reason for him to believe that the pony would help him. So he was just basically playing with a toy that he made himself and then the toy became real, Velveteen-Rabbit-style. Unless there's some kind of tradition of making ponies out of mud and treating them as if they're real, and it does not imply that there is.