The @BeforeScenario hook executes not only before each scenario in each feature, but before each example row in the scenario outline. Yes, each scenario outline example row works almost the same as a usual scenario, except that it sends a different event: Behat\Behat\Event\OutlineExampleEvent.
@AfterScenario functions exactly the same way, except after each scenario in each feature.
So, the @BeforeScenario or @AfterScenario hook will receive either a Behat\Behat\Event\ScenarioEvent or Behat\Behat\Event\OutlineExampleEvent instance, depending on the situation. It’s your job to differentiate between them if needed.