A capability is a way to attach data to an object that doesn't belong to you. IE the player.
It's actually incredibly simple.
You need a Capability instance with the @CapabilityInject annotation above it.
You need to register your Capability using CapabilityManager.INSTANCE.register(Class<Some Base class where your capability data will be stored>, new IStorageInstance, new Callable)
The IStorageInstance has two methods that save and load data for the capability. The new Callable needs to create an instance of your base class.
Then you also need to use the AttachCapabilitiesEvent to attach it to the object you want to attach it to. You use
AttachCapabilitiesEvent#addCapability(ID, new ICapabilityProvider)
The ICapabilityProvider is the object that provides the way to get the Capability data from the object it is attached to.