It then runs code which auto detects the car model (fairly easy from the messages on the bus), and has a database of the messages to send/inhibit to change the behaviour in the desired way.
Because so many cars use electronics that are common across a whole manufacturer of cars - ie. all GM cars, or all cars with a Bosche ECU - there won't be awful lot of work making it compatible with hundreds of models of car.
Such devices already exist for faking data for engine tuning, and for faking 'zero faults, all monitors pass' to pass government tests.