Can someone explain how to get id from url with kwargs and how it is really working

class CartItemViewSet(ModelViewSet):
    serializer_class = CartItemSerializer

def get_queryset(self):
    return CartItem.objects.filter(cart_id=self.kwargs['cart_pk'])

did not understand the significance of cart_pk and from where it came