They both are a bit sad and go slowly. So why are they considered different genres?
According to iTunes, they're both Pop. And Discogs says they're both Pop too. And so does Genius.
So what's the takeaway here? Well, it could be one of a few things.
Google is wrong.
Certainly a possibility, as none of these other sources seems to say that the genre of "Love Yourself" is Electronic or Dance.
Maybe genres are, in a lot of ways, meaningless?
This excellent answer on another question on this site details the history of genres, and how they were created for marketing purposes and to segregate artists by race. And this other excellent answer describes the difference between Soul, Funk, and R&B as genres and how some artists identified as "Funk" bands but no artists really identified as "R&B" bands.
In this case, Google is probably wrong, but it's definitely good to keep in mind that the genre a specific website, record label, radio station, or magazine might put on a song might be completely different from what genre a similar entity (or even the artist themselves) might put on the song.