A test that creates its own data is only maintainable if creating it is one line, and a state is what makes it one line.
public function gold(): static
{
return $this->state(fn () => ['tier' => 'gold', 'credit_limit_cents' => 500_000]);
}
public function withOverdueOrders(int $count = 3): static
{
return $this->has(
Order::factory()->count($count)->overdue(), 'orders'
);
}
// Customer::factory()->gold()->withOverdueOrders()->create();
Without states the explicit fixture is six lines of attribute assignment and people start querying for existing data instead, which reintroduces the ordering dependency. The states also document the domain: a list of factory methods is a readable summary of which states a model is expected to be in.