Does ModelForm render a separate HTML form with populated inputs when an instance is passed

Model:

class X(models.Model):
  x = models.CharField(max_length=255)

Form:

class XForm(forms.ModelForm):
  class Meta:
    model = X

Create view:

def create(request):
  xform = XForm()
  return render(request, "create.html", { "form": xform }>

Template:

<form action="" method="post">
  {{ form }} <!-- XForm -->
  <!-- <label for="id_x">X</label> -->
  <!-- <input type="text" name="x" id="id_x"/> -->
  <input type="submit" value="Post">
</form>

Edit view:

def edit(request, id):
  x = X.objects.findById(id)
  # x.x = "A"
  xform = XForm(instance=x)
  return render(request, "edit.html", { "form": xform }>
<form action="" method="post">
  {{ form }} <!-- XForm -->
  <!-- <label for="id_x">X</label> -->
  <!-- <input type="text" name="x" id="id_x" value="A" /> -->
  <input type="submit" value="Edit">
</form>

How does ModelForm render a HTML forms? Does it render a separate HTML form with populated inputs when an instance is passed or render a single form with dynamically populated inputs when both instance is passed and not?

Does ModelForm do this:

<input type="text" name="x" id="id_x"/> <!-- Form 1, xform = XForm() -->
<input type="text" name="x" id="id_x" value="A" /> <!-- Form 2, xform = XForm(instance=x), x.x = "A" -->

Or this?

<input type="text" id="id_x" {% if x %}value="{{ x.x }}"{% endif %}/> <!-- Form 1, xform = XForm() -->
<input type="text" id="id_x" {% if x %}value="{{ x.x }}"{% endif %}/> <!-- Form 1, xform = XForm(instance=x), x.x = "A" -->

The rendering of the individual fields within a form are defined by the appropriate widget templates. See the docs at Widgets | Django documentation | Django and the templates in django.forms.templates.django.forms.widgets.