Their doors were unlocked, or may have been unlocked mechanically by tampering with the locking mechanism (think slim jim). It's theoretically possible to crack the codes exchanged between key remotes and the vehicles, just as with garage door remotes, but is exceedingly improbable unless done by a state actor. It's infinitely easier for the average knucklehead bad guy to look for a unlocked car, since many cars are carelessly left in that state, than to be bothered using sophisticated electronics to try to defeat door locks.