What do the parameters used in crop mean?
Lets say my image is called frame and x, y, w and h are xmin, ymin, xmax and ymax

You're confusing $w$ with $xmax$ and $h$ with $ymax$: Usually $w$ is the width of the crop whereas $xmax$ is the horizontal position of the end of the crop. Similarly $h$ is the height and $ymax$ is the vertical position of the end of the crop.
Logically since $x$ is the (horizontal) start of the crop and $w$ is the width, we can obtain $xmax$ like this: $xmax=x+w$.
Example: in a 100x100 image, let's say we want to crop a 20x20 square in the centre: $x=40, y=40, w=20, h=20, xmax=60, ymax=60$.
In the following code:

frame = frame[y:y + h, x:x + w]


the operator : is used to represent a sequence (for instance 3:7 means 3,4,5,6) so y:y + h represents the sequence from y to y+h, i.e. from $y$ to $ymax$. Same for x+w, so this line would select the part of the array corresponding to the crop.
Your second example is wrong due to the same confusion, the actual code is:
face = frame[startY:endY, startX:endX]

In this case the author is directly using the end coordinate endY (same as $ymax$) instead of calculating it as startY+h.