She may not have written it, may have just recorded it.
So many of the pop country stars these days get their songs from the Nashville Songwriting Consortium (just made that name up, but it aptly describes the boardroom songwriting methodology).
According to Wikipedia, Shania was the co-writer of “Whose Bed ...” with Mutt Lange, to whom she was then married. Same with “Any Man of Mine,” a stupid song with a catchy beat.