The heating of the water inside the soap causes the expanding effect. The heat causes bubbles in the water and trapped air to expand. The soap becomes soft because of the heat. The effect is actually a demonstration of Charles' Law.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.