It’s never explained during the run of the series.
The unseen character apparently died at some point in the relatively near past as Opie, who is roughly 7–8 years of age at the beginning of the series, has vivid memories of her being alive which he would not if she had died when he was much younger. Additionally, Andy Taylor, the series protagonist, has apparently worked his own way through the grieving process by the time of the series premiere, which also means that at least 1–2 calendar years have passed between her apparent death, and the first episode.
The series, being a comedy in the 1960s, rarely injected dramatic elements into the narrative and when it did, they were there to enhance that episodes ongoing narrative, not to “flesh out” existing characters, nor to provide the overarching themes of the program with any sort of context.
That means that explaining Andy’s widower status was never seen to be a pressing issue as it might take viewers out of the necessary sense of humor that they would require to enjoy the program’s comedy elements. An unseen and unexplained death was “enough” for viewers at that time (television was still in its relatively infancy then) and so the program simply avoided that narrative element whenever it was possible to do so.
So questioner, the answer seems to be that she died before the pilot episode, and that the series never explains the “hows” or “whys”.
In “The Andy Griffith Show,” Andy Griffith’s character, Sheriff Andy Taylor, was a widower. His wife’s name was referenced as being “Ellie” or “Rose” in various episodes, but she was never shown on the show or given a full backstory. The character of Andy Taylor was depicted as a single father raising his son, Opie, with the help of Aunt Bee and other residents of Mayberry. The absence of Andy’s wife was an intentional choice made by the show’s creators to focus on the dynamics of the small-town community and the relationships between the characters.