The math in one line
output = sigmoid(w1 x x1 + w2 x x2 + b), where sigmoid(z) = 1 / (1 + e^(minus z)). In this model input 2 is fixed at 0.6 with weight 1.5, so it adds 0.9 to the sum.
This is a teaching example with hand-picked numbers, not a trained irrigation model. Real networks stack thousands or millions of these units in layers, and many modern ones use other activation functions such as ReLU.
How learning works
During training, the network compares its output with the correct answer and computes how much each weight contributed to the error. Gradient descent then nudges every weight and bias a little in the direction that reduces the error, repeated over many examples.