Original: When the silk ran out she saw a small cocoon and realized that this cocoon was the source of the silk.
Simplified: When the silk ran out, she saw a small cocoon, and realized that this cocoon was the source of the silk.