At the end of Thor: Ragnarok we see Thanos's ship over the Asgardians. All this time he has neither invaded the nine Realms nor Asgard but now he decided to come after the destruction of Asgard and the death of Odin. Is it plausible to say that because of Odin all the threats have now come to light such as Hela, Surtur, and Thanos?
There's a few scenes in the film and other details that possibly answer this:
- Odin's Vault is already established in the MCU as a heavily protected vault holding several dangerous artifacts, each with the potential to bring about Ragnarok.
- Hela walks through the vault, knocking over what appears to be the infinity gauntlet inset with the Infinity Stones and stating it's fake. However, when she sees a blue cube, she notes "That's not bad," indicating the cube is real, unlike most of the other artifacts. A little bit of digging12 reveals this is the cosmic cube, which in the MCU is the Tesseract, the container for the Space Infinity Stone.
- In the hangar scene, when Loki attempts to sabotage the escape plan by raising the alarm, Thor says Loki will always be the god of mischief.
- Finally, in the bridge fight scene, when Thor sends Loki to find Surtur's crown, Loki takes interest in what we now know is the tesseract.
From all this we know:
- The Infinity Gauntlet on Asgard is fake,
- The Tesseract on Asgard is real,
- The Space Stone is in the Tesseract,
- Odin's Vault is heavily protected,
- Loki is likely to continue causing mischief and trickery
I think it's a safe bet the Vault was what prevented Thanos getting the Space Stone, and may have even prevented him knowing where it was, thus there was no reason for him to attack Asgard. It's also safe to assume Loki stole the Stone when he saw it in the vault. With Asgard and the Vault destroyed, the Stone was out in the open, and Thanos could easily find it.
All that being said, the answer may be much more simple: in the end-credits scene in Age of Ultron, after both Ronan (Guardians) and Loki fail to retrieve the Stones for him, Thanos says "fine, I'll do it myself." He may have only just started actively searching for the Stones, and the scene in Thor: Ragnarok may just be the first time he finds one.