As a prefix, sub- means that the modified word is underneath, below, or in some way less than something else. It can mean a lower level of classification or a smaller part of something bigger.
With one exception, sub- words do not use a hyphen inside the United States. Outside, including Canada, most sub- words use a hyphen in their official spellings.
Infra- is also an prefix that can mean below, but usually means inside or within.
With a few exceptions, whether the classification uses sub- or infra- seems to be largely a matter of preference for the scientist naming the category. One could assume (taking into account the risks in doing so) that perhaps in the distinct examples one word already existed when another was needed.
One example of a distinct difference is subsonic and infrasonic. Subsonic is an adjective describing things as moving slower than sound moves. It dates from the 1930s. Infrasonic is an adjective describing things as being related to a certain range of sound that humans can’t hear. It dates from the 1920s. In this example, infra- means below on a scale and sub- means less in a comparison.
Another example is infrastructure and substructure. Infrastructure is the basic needs for a civilization to function, also the framework or foundation of an organization or group. This term dates to the 1930s. Substructure is simply a supporting part of a building that is underneath something else. This term dates to the 1700s. In this example, infra- means within or inside and sub- means below.