We define curvature by looking at the behavior of straight lines. In a flat space, straight lines that are parallel to one another at one point will be parallel everywhere and will never meet. In a curved space, they will (think about the lines of longitude on the surface of the earth; they're parallel at the equator but meet at the poles). The definition of a straight line in spacetime is a bit trickier (it turns out that the paths of objects in free fall are straight lines, properly called "geodesics", through spacetime) but the same general idea holds.
The curvature of spacetime at any given point is related to the distribution of matter and energy at that point by the Einstein field equations. Dark energy and dark matter are just one more thing in that distribution.