Doubt regarding use of name attribute in input tag

in radio, all the are written the same, and then we can only select one of them. e.g male, female, other we can only choose one of them

but when I write the name attribute as the same for text type input it accepts the different text input.
eg i have two text type input for first name and last name and for both i write (<input type= “text” name =“name”)

why is it so ?