Notoriously, husbands tend to see their wives as hot, when they would never see some other woman of similar age as hot. If they are separated from their wife for a year or so, for example by divorce, the wife goggles fall off.
Wife goggles appear to happen primarily to fathers. If the wife does not have children, then as she grows older, she rapidly becomes less attractive, as any woman rapidly becomes less attractive past thirty.
In the ancestral environment, particularly in northerly lands, women and children were dependent on males for food. Therefore we are descended disproportionately from males who stuck around, but we are also descended disproportionately from males who only saw fertile age women as attractive.
One possible resolution of these conflicting requirements (natural selection wants man to hang out with fertile age woman, but natural selection wants man to stick with the mother of his children) is for a man to see his wife as always that age when he had children with her, or always as sexually attractive as she was at that age, which is to some substantial extent what happened to me. Which suggests that one should have children as young as possible.