How does CNN doing bounding box regression and what do features and weights represent for?
It depends on the concrete model, but we can consider the most popular single-stage model for object detection: SSD. 

It has a set of default bounding boxes (prior boxes), for each of them it predicts:


Probability distribution over the set of classes (this is a classification problem, solved with crossentropy loss)
Offsets for the default location of the prior box (x, y coordinates for the center) and its height/width. This is a regression problem optimized with smoothed L1 loss (localization loss):




The exact definition is a bit more complicated, as it includes variance and exponents, but the general idea is like this. Also, depending on the bounding box encoding type, we may predict offsets not for the (cx, cy, w, h), but for (xmin, ymin, xmax, ymax).

The predicted shape offsets for prior boxes are not absolute values, of course. These values are relative to the default size of the prior box. The exact formulas for decoding are: