The Sort.by(Sort.Direction.DESC, "bId") method uses the expression bId. Spring Data JPA interprets it as a CamelCase path consisting of the b field in the object of class A and the id field of the object that b points to, which is the object of class B.
For more information, see the Spring Data JPA documentation.