Persistent Systems Interview Question

How does compiler know which function to run at runtime?(i.e. vtable and vptr)