Css : nth child selector

i was solving one of the exercises " Handlebars ", could’t help notice the css coded.
i see below code

.block:nth-child(2n){

background-color: #4b54ef;

margin-left: 25px;

}

can someone explain in detail about this code snipet
https://www.codecademy.com/paths/web-development/tracks/build-interactive-websites/modules/templating-with-handlebars/lessons/learn-handlebars/exercises/handlebars-each-this-i

Take a look at the MDN web docs on the topic: They explain (clearly and in-depth) nth-child syntax and use.

For a more “learner-targeted” experience, try CSS-Tricks.