Unlike a Waterfall project, an Agile project embraces the fact that we know the least about a project when it starts. We begin by identifying use cases and stories needed to create a minimum-viable product. From here, we create a rough estimate of the size of each story. The work is then prioritized and work begins. Every few weeks, new features and produced and demonstrated with the customer providing feedback. The plan is then adjusted accordingly. Using continuous integration and deployment allows for fast feedback from customers and users.
As more work is completed, the amount of time to complete features becomes more consistent, and within a few iterations, we can establish a reasonable estimate of time and cost. The customer has complete control over the process, both in its transparency, but also in guiding the order in which work is done to maximize feedback and ROI.
Still unsure? Check out this article from Forbes.