It really comes down to time, price and availibility. Sometimes an engine or transmission isn't available in the aftermarket.
Engine rebuilds cost upwards of $4,000 but an engine replacement costs anywhere between $3,000 to $7,000.