Okay Science, explain this

Why did my half used can of expanding foam do this after sitting in the pantry for a few days?