The base detection and attack mechanics are a bit complicated, but that's how it always have been.
1. A UFO (or a foot party) patrols in the general region (eg. North Africa) where your base is located. How do they know which region? I guess it's random, but you can call it gossip or someone tipped them off. If a UFO flies close to your base (no idea on the exact range) it has a *chance* (with bonus depending on base size) to discover it. There is no attack right away, the discovering UFO just flies away. I heard that if you shoot the UFO before they had a chance to detect you base you have a chance to interrupt the retaliation altogether - not sure if it's a planned feature or already implemented.
2. After a couple of days an 'assault' UFO appears, heading straight for your base at full speed. The major factions use specialized UFOs for that (Boarding Torpedo, Breaker, Assault Transport or Cruiser), with speeds over 5000kt, so these are almost impossible to intercept and very hard to detect. The last part is due to the fact, that radar sweeps are made every 30 minutes (and not 100% successful). In this time an assault craft can cover over 2500 miles, which is the general range of a base radar (craft have significantly less). So it is entirely possible that the assault UFO can reach your base before any radar can even pick them up. Not sure how dark ones and ratmen do it - if they use similar vessels or a different mechanic (besides - realistically, how would a radar detect a squad of soldiers on foot?).
3. After the assault craft reaches the base, the defenses get a chance to fire. They need to do enough damage to destroy the attacking vessel. There is no crashing and AFAIK any damage that didn't destroy the ship is irrelevant*. So with anti-UFO defense you go big or not at all. Not sure if assault craft size matters for to-hit consideration.
4a. If the assault craft is destroyed before landing, another one is sent in a couple of days, ad nauseam. Either your defenses fail at some point, or you get a steady stream of attacks. Basically you *will* have a base defense mission at some point, anti-UFO just gives you time to prepare and do it on your terms. Not sure if destroying an assault craft gets you points or not.
4b. The craft is not destroyed - it lands successfully - the base defense mission starts. If you win - the aliens 'forget' about your base and will not send another assault craft. But they can still start the retaliation mission again and detect the base again and so on, the process repeats. If you lose - well, you lose the base and the retaliation is over as well.
If i'm wrong somewhere, please correct me.
* As a point of reference, you need 2 flak cannons or SAM sites to reliably shoot down the smallest attack unit (the Torpedo - 400dmg). One of any of those has a chance to do it (on good roll) but it's in no way reliable.