Complex sentence: An API is usually related to a software library: the API describes and prescribes the "expected behavior" (a specification) while the library is an "actual implementation" of this set of rules.
Split into simpler sentences: An API is usually related to a software library. The API describes and prescribes the "expected behavior" (a specification) while the library is an "actual implementation" of this set of rules.