Before the layers touch, the outer layer is hotter than the inner layer. Once the layers are touching, the outer layer will transfer kinetic energy to the molecules in the cooler inner layer until both layers reach the same temperature, which will be in between their starting temperatures.