Inter-layer interactions and the origin of SiC polytypes