How to put form in a block programmaticaly

Putting some form in a block is matter of creating a new block and assigning a form to it through form_builder that is called through dependency injection(DI) and then using method getForm that will get rendered array of this form, which is exactly what build method for block expects to output

Event subscribers and listeners, the short version

In drupal 8 we have cool new thing, instead of hooks we can use event subscribers and create event listeners. They do similar things as hooks, we can do something on certain "events" in system, get data and change it or somehow act upon it.

So to subscribe to some event we need to do a service with tags in it, like

Get entity object in form alter

If you need to get entity object in form alter, you can get it with this method

$entity = $form_state->getFormObject()->getEntity();

and form then you can get info you need, use methods on it etc