What is the purpose of the Step Definition file in Cucumber?

A step definition is the actual code implementation of the feature mentioned in the feature file. A step definition file in Cucumber is used to segregate the feature files from the underlying code. Each step of the feature file can be mapped to a corresponding method on the Step Definition file.

While feature files are written in an easily understandable language such as Gherkin, Step Definition files are written in programming languages such as Java, .Net, Ruby etc.