Cucumber is a command-line tool that reads specifications from plain-language text files but cucumber itself does not have any idea as how to execute the scenario steps. Cucumber needs step definition to convert Gherkin step into some desired activity.
Whenever cucumber executes any step then it looks its respective step definition in the entire project and execute the code written inside the step definition.
Step definition may contain a single line code or a multi-line code depending on the steps logic.
And(/^I should see Terms and Conditions overlay$/) do
In the above example as we can see that only single line code is associated with “I click Registration link” step but multiline code is associated with “I enter valid data for Registration”. If the same step is written with different Gherkin keywords in the Feature then also we do not have to re-write the steps again. Cucumber while reading the step definition ignore Gherkin keywords.