I find black medick a troublesome plant to identify as it can be so variable in size depending on how much grazing and wear it gets. Small, well worn specimens can look very much like other trefoil (or clover) species and it is easy to make a mistake. Where the plant has a degree of protection near a wall or on a bank it can grow quite large and can then be mistaken for hop trefoil! For such a common flower it really is a trial!
It is called black medick because, unlike other trefoils and this can help identification, it produces black seeds which were believed to have medicinal powers. It also differs from trefoils because the leaf is a slightly different shape to those species but you will need to look in a suitable field guide to see what I mean.