My current understanding is that tools that implement this functionality do so by dynamically creating a builder by reading the config in builder.toml, then modifying the buildpacks it includes, and specifying the order in which the buildpacks should be used for detection.
E.g. pack does this here: https://github.com/buildpacks/pack/blob/main/pkg/client/create_builder.go
This also enables multi-buildpack builds without the hack of injecting additional buildpacks after the detect phase.
Heroku likely has it's own custom implementation of this, while Tekton (afaik) doesn't have any native support for modifying the base builder.