Waxy casts are formed when there is a prolonged period of low urine flow, which leads to the degeneration of cellular casts. This degeneration results in the formation of a homogeneous matrix that has a waxy, brittle appearance. The process usually involves a series of transforming stages, starting from granular casts to waxy casts.