Spark is brilliant in how it works with data. When you tell Spark to work on a particular dataset, it listens to your instructions and writes them down so it doesn't forget, but it doesn't do anything until you ask for the result. When a function like a map() is called on an RDD, the change doesn't happen immediately. In Spark, transformations aren't evaluated until you do something. This helps improve the way data is processed as a whole.